package com.kailong.dto;

/**
 * created by kailong on 2025/8/4
 */
import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Setter
@Getter
public class PageResultDTO<T> {
    private List<T> records;
    private long total;
    private int current;
    private int size;
    private int pages;

    public PageResultDTO() {}

    public PageResultDTO(List<T> records, long total, int current, int size) {
        this.records = records;
        this.total = total;
        this.current = current;
        this.size = size;
        this.pages = (int) Math.ceil((double) total / size);
    }

}
